
Partial Class Login
    Inherits System.Web.UI.Page
  
    Protected Sub logeo_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles logeo.Authenticate
        Dim estaValidado As String

        estaValidado = New capaLogica.GestorCuenta().identificarEstudiante(logeo.UserName.Trim(), logeo.Password.Trim())
        ClientScript.RegisterHiddenField("__EVENTTARGET", "LoginButton")
        If estaValidado IsNot Nothing Then
            e.Authenticated = True
            Dim estudiante As ArrayList = New capaLogica.GestorRegistrarEstudiante().BuscarEstudiante(logeo.UserName.Trim())
            Session("nombre") = estudiante.Item(0)
            Session("id") = logeo.UserName
            FormsAuthentication.RedirectFromLoginPage(logeo.UserName, False)
        End If

    End Sub
End Class
